// 模型基类
class BaseModel {

    constructor( db ) {
        this.db = db
    }

    /**
     * 查询单条记录
     * @param {条件} where Json
     * @return Promise
     */
    all( where = {} ) {
        return this.db.find( where )
    }
    first( where ) {
        return this.db.findOne( where );
    }
    store (data) { 
      return this.db.insertMany( data );
    }
}
module.exports = BaseModel